<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html:html lang="true">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><bean:message key="welcome.title"/></title>
        <link rel="stylesheet" type="text/css" href="css/cas.css"> 
        <html:base/>
    </head>

    <body>

        <logic:notPresent name="org.apache.struts.action.MESSAGE" scope="application">
            <div  style="color: red">
                ERROR:  Application resources not loaded -- check servlet container
                logs for error messages.
            </div>
        </logic:notPresent>

        <h1><bean:message key="welcome.title"/></h1>

        <html:form action="/Login"> 
            
            <fieldset class="login"> 
                <legend>Login Details</legend> 
                <div> 
                    <label for="username">User Name</label> <html:text property="userName" size="60"/> 
                </div>
                
                <logic:messagesPresent>
                    <div style="color: #f00"> 
                        <label for="username">&nbsp;</label>
                        <html:messages id="msg" property="userName">
                            <bean:write name="msg" />
                        </html:messages>
                    </div>
                </logic:messagesPresent>

                <div> 
                    <label for="password">Password</label> <html:password property="password" size="60"/> 
                </div> 
                
                <logic:messagesPresent>
                    <div style="color: #f00"> 
                        <label for="password">&nbsp;</label>
                        <html:messages id="msg" property="invalidLogin">
                            <bean:write name="msg" />
                        </html:messages>
                    </div>
                </logic:messagesPresent>
                
            </fieldset> 
               <br/>
            <div><html:submit value="Login" /></div> 

        </html:form> 
    </body>
</html:html>